﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text;
using IDAL.A;
using Model.A;

namespace DAL.A
{
    public class ATestItem:BaseRepository<ATestItemInfo>,IATestItem 
    {
        #region 静态变量部分
        private const string PARM_ATESTITEM_SN = "@SN";
        private const string PARM_ATESTITEM_RECORDTIME = "@RecordTime";
        #endregion

        #region 数据检索部分

        public IList<ATestItemInfo> ATestItem_GetbySNDT(string sn, DateTime recordTime)
        {
            SqlParameter[] parms = GetSNDTParameters();
            parms[0].Value = sn;
            parms[1].Value = recordTime;
            return ExcuteSqlToGetEntities("ATestItem_selectbySNDT", parms);
        }
        #endregion

        public SqlParameter[] GetSNDTParameters()
        {
            SqlParameter[] parms = null;
            parms = new SqlParameter[]
                {
                    new SqlParameter(PARM_ATESTITEM_SN, SqlDbType.NVarChar,50),
                    new SqlParameter(PARM_ATESTITEM_RECORDTIME, SqlDbType.DateTime,8),
                };
            return parms;
        }


        #region 重写基类部分
        //-------------------------------------重写超类基础操作---------------------------------------------------------

        public override ATestItemInfo GetEntityRecord(SqlDataReader rdr)
        {
            ATestItemInfo pro = new ATestItemInfo(rdr.GetValue(0).ToString(), rdr.GetValue(1).ToString(), rdr.GetDateTime(2), rdr.GetValue(3).ToString(), rdr.GetValue(4).ToString());
            return pro;
        }
        #endregion
    }
}
